package junyi.power.actions;

import junyi.card.Card;
import junyi.card.CardFilter;
import junyi.player.Player;
import junyi.power.Action;
import junyi.power.effects.Effect;
import junyi.power.effects.EffectSource;
import junyi.power.effects.PickObject;

import java.util.List;

/**
 * User: Junyi BEI
 * Date: 12-9-30
 * Time: 下午4:26
 */
public class TargetPlayerUseCard extends Action {
  private Player target;
  private List<Card> cards;
  private CardFilter cardFilter;

  // target -> source -> card_filter
  public TargetPlayerUseCard(Player t, List<Card> cs, CardFilter cf, EffectSource es) {
    super(es);
    target = t;
    cards = cs;
    cardFilter = cf;
  }

  @Override
  public int start(int c) {
    List<Card> hand = target.getHand();
    Effect pickDodge = new PickObject(target, cardFilter.doFilter(cards), effectSource);
    return pickDodge.start();
  }

  public Player getTarget() {
    return target;
  }

  public void setTarget(Player target) {
    this.target = target;
  }

  public List<Card> getCards() {
    return cards;
  }

  public void setCards(List<Card> cards) {
    this.cards = cards;
  }

  public CardFilter getCardFilter() {
    return cardFilter;
  }

  public void setCardFilter(CardFilter cardFilter) {
    this.cardFilter = cardFilter;
  }
}
